import request from '@/config/axios'

// 项目成员中间 VO
export interface ProjectMemberVO {
  projectId: number // 项目ID
  memberId: string // 成员ID
}

// 项目成员中间 API
export const ProjectMemberApi = {
  // 查询项目成员中间分页
  getProjectMemberPage: async (params: any) => {
    return await request.get({ url: `/pypm/project-member/page`, params })
  },

  // 查询项目成员中间详情
  getProjectMember: async (id: number) => {
    return await request.get({ url: `/pypm/project-member/get?id=` + id })
  },

  // 新增项目成员中间
  createProjectMember: async (data: ProjectMemberVO) => {
    return await request.post({ url: `/pypm/project-member/create`, data })
  },

  // 修改项目成员中间
  updateProjectMember: async (data: ProjectMemberVO) => {
    return await request.put({ url: `/pypm/project-member/update`, data })
  },

  // 删除项目成员中间
  deleteProjectMember: async (id: number) => {
    return await request.delete({ url: `/pypm/project-member/delete?id=` + id })
  },

  // 导出项目成员中间 Excel
  exportProjectMember: async (params) => {
    return await request.download({ url: `/pypm/project-member/export-excel`, params })
  }
}